package gui.display;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JTextField;
import utils.ServerConnection;

/**
 *
 */
public class ServerDisplay extends Display
{
    private final ServerConnection server_;

    public ServerDisplay( final ServerConnection server )
    {
        super();

        server_ = server;
        inputField_.addActionListener( new ActionListener() {
            public void actionPerformed( ActionEvent e )
            {
                JTextField source = (JTextField) e.getSource();
                server_.handleInput( source.getText() );
                source.setText( null );
            }
        });
    }

    public final void print( String message )
    {
        printStyledText( message, REGULAR );
        printNewLine();
    }

    public final void userPrint( String message )
    {

    }
}
